//
//  DashedRectangle.m
//  IYTLCProduct
//
//  Created by administrator on 2017/4/1.
//  Copyright © 2017年 hs. All rights reserved.
//

#import "DashedRectangle.h"
#import "UIColor+ColorUtility.h"

@implementation DashedRectangle

- (void)drawRect:(CGRect)rect
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetStrokeColorWithColor(context, [UIColor convertHexToRGB:@"#e7ebf0"].CGColor);
    CGContextSetLineWidth(context, 1.5);
    CGContextMoveToPoint(context, 0, 0);
    CGContextAddLineToPoint(context, CGRectGetWidth(rect), 0);
    CGContextAddLineToPoint(context, CGRectGetWidth(rect), CGRectGetHeight(rect));
    CGContextAddLineToPoint(context, 0, CGRectGetHeight(rect));
    CGContextAddLineToPoint(context, 0, 0);
    CGFloat arr[] = {4, 2};
    CGContextSetLineDash(context, 0, arr, 2);
    CGContextDrawPath(context, kCGPathStroke);
}

@end
